﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SocialFilter.model
{
		class FeedItem : IComparable<FeedItem>
		{
				private string content;
				private string source;					// website the content came from
				private string author;					// user who published the content
				private DateTime timeStamp;		// time that the item was published
				private string link;						// url of the item

				// constructors
				public FeedItem()
				{
					content = "";
					source = "";
					author = "";
					timeStamp = new DateTime();
					link = "";
				}
				
				public FeedItem( FeedItem f )
				{
					Content = f.Content;
					Source = f.Source;
					Author = f.Author;
					TimeStamp = f.TimeStamp;
					Link = f.Link;
				}
				
				public FeedItem( string _content, string _source, string _author, DateTime _timeStamp, string _link )
				{
					Content = _content;
					Source = _source;
					Author = _author;
					TimeStamp = _timeStamp;
					Link = _link;
				}
				
				public string Content
				{
					get { return content; }
					set { content = value; }
				}

				public string Source
				{
					get { return source; }
					set { source = value; }
				}

				public string Author
				{
					get { return author; }
					set { author = value; }
				}
				
				public DateTime TimeStamp
				{
					get { return timeStamp; }
					set { timeStamp = value; }
				}
				
				public string Link
				{
					get { return link; }
					set { link = value; }
				}
				
				public int CompareTo( FeedItem _rhs )
				{
					return _rhs.TimeStamp.CompareTo(timeStamp); //comparing this way allows sort to put the newer items first
				}
		}
}
